<template>
<div class="detail">
  <detail-header
  :title = "sightName"
  :bannerImg = "bannerImg"
  :bannerList = "gallaryImgs"
  ></detail-header>
  <recommend></recommend>
  <detail-list :list = "categoryList"></detail-list>
</div>
</template>

<script>
import detailHeader from './components/header'
import detailList from './components/list'
import recommend from './components/recommend'
import axios from 'axios'
export default {
  components: {
    detailHeader,
    detailList,
    recommend
  },
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      categoryList: []
    }
  },
  mounted () {
    this.getListInfo()
  },
  methods: {
    getListInfo () {
      axios.get('/api/detail.json').then(this.getListInfoSucc)
    },
    getListInfoSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.sightName = data.sightName
        this.bannerImg = data.bannerImg
        this.gallaryImgs = data.gallaryImgs
        this.categoryList = data.categoryList
      }
    }
  }
}
</script>

<style>
.detail { background:#f5f5f5;}
</style>
